<template>
  <div>{{ decryptedText }}</div>
</template>

<script setup lang="ts">
import CryptoJS from 'crypto-js';

// Encrypted text received from Java
const encryptedText = 'jIq+TOBG5P1WzTWvBfKhlfVGg7eA3O0+/YvbItx5VYJ65uFpKtCZOHK1EOomQ/rjdi/SVokISpVZO2isekffvTz2sD0dorHbSaXm9lwFmt0='; // Replace with your actual encrypted text

// AES key (must match the key used in Java)
const AES_KEY = '1a2b3c4d5e6f7g8h'; // Replace with your actual AES key

// Function to decrypt the encrypted text
const decryptText = () => {
  try {
    const key = CryptoJS.enc.Utf8.parse(AES_KEY);
    const decrypted = CryptoJS.AES.decrypt(encryptedText, key, {
      mode: CryptoJS.mode.ECB,
      padding: CryptoJS.pad.Pkcs7
    });

    return decrypted.toString(CryptoJS.enc.Utf8);
  } catch (error) {
    console.error('Error decrypting:', error);
    return null;
  }
};


const decryptedText = decryptText();

</script>

<style scoped>
/* Your scoped styles here */
</style>
